home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / cool / ge_cool.lha / GE_COOL2.1 / man / oldman3 / Date_Time.3T < prev    next >
Text File  |  1992-06-26  |  11KB  |  344 lines

  1. .TH DATE_TIME
  2. .SH NAME
  3. Date_Time  Time zone-independent date and time class
  4. .SH SYNOPSIS
  5. #include <cool/Date_Time.h>
  6. .SH DESCRIPTION
  7. The 
  8.  Date_Time 
  9. class executes time zone-independent date and time functions.  
  10. This class supports calendar operations and input and output based upon the 
  11. value of an environmental synonym, such as 
  12.  
  13.  US_CENTRAL .  
  14. This class supports all 
  15. time zones in the world, along with several special cases requiring alternate 
  16. handling based upon political or daylight saving time differences. Unlike the 
  17. ANSI C date and time funtions, this class supports dates before the epoch 
  18. (January 1, 1970). Year values specified between 0 and 99 are assumed to be in 
  19. the twentieth century.
  20. .SH Base Classes
  21.  
  22. .SH Friend Classes
  23. None
  24. .SH Public Constructors
  25. .TP
  26.  Date_Time ();
  27. Allocates a date and time object with the default time zone and country. A 
  28. Warning exception is raised if the default country or the default time has not 
  29. been set for the class.
  30. .TP
  31. \f3Date_Time (const Date_Time& \f2dt\f3);\f1
  32. Duplicates the size and entries of a date and time object 
  33.  dt . 
  34. .TP
  35. \f3Date_Time (time_zone \f2tz\f3, country \f2c\f3);\f1
  36. Allocates a date and time object with time zone
  37.  tz 
  38. and country code 
  39.  c .
  40. .SH Member Functions
  41. .TP
  42.  const char* ascii_date () const;
  43. Returns the date in ASCII format for the appropriate time zone and country.
  44. .TP
  45.  const char* ascii_date_time () const;
  46. Returns the date and time in ASCII format for the appropriate time zone and 
  47. country.
  48. .TP
  49. \f3const char* ascii_duration (const Date_Time& \f2dt\f3) const;\f1
  50. Returns the duration of time between the date/time object and 
  51.  dt 
  52. in ASCII format.
  53. .TP
  54.  const char* ascii_time () const;
  55. Returns the time in ASCII format for the appropriate time zone and country.
  56. .TP
  57. \f3inline void decr_day (int \f2n = \f11\f3);\f1
  58. Decrements the time by the specified number of days.  The default is one.
  59. .TP
  60. \f3inline void decr_hour (int\f2 n = \f11\f3);\f1
  61. Decrements the time by the specified number of hours. The default is one.
  62. .TP
  63. \f3inline void decr_min (int \f2n = \f11\f3);\f1
  64. Decrements the time by specified number of minutes. The default is one.
  65. .TP
  66. \f3void decr_month (int \f2n = \f11\f3);\f1
  67. Decrements the time by specified number of months. The default is one.
  68. .TP
  69. \f3inline void decr_sec (int \f2n = \f11\f3);\f1
  70. Decrements the time by specified number of seconds. The default is one.
  71. .TP
  72. \f3inline void decr_week (int \f2n = \f11\f3);\f1
  73. Decrements the time by the specified number of weeks. The default is one.
  74. .TP
  75. \f3void decr_year (int \f2n = \f11\f3);\f1
  76. Decrements the time by the specified number of years. The default is one.
  77. .TP
  78. \f3void end_day (int \f2n = \f11\f3);\f1
  79. Advances the time by the specified number of days, setting the time to 
  80. 23:59:59.  The default is one.
  81. .TP
  82. \f3void end_hour (int \f2n = \f11\f3);\f1
  83. Advances the time by the specified number of hours, setting the time to 
  84. hh:59:59.  The default is one.
  85. .TP
  86. \f3void end_min (int \f2n = \f11\f3);\f1
  87. Advances the time by the specified number of minutes, setting the time to 
  88. hh:mm:59.  The default is one.
  89. .TP
  90. \f3void end_month (int \f2n = \f11\f3);\f1
  91. Advances the time by the specified number of months, setting the time to 
  92. 31/mm/yyyy 23:59:59.  The default is one.
  93. .TP
  94. \f3void end_week (int \f2n = \f11\f3);\f1
  95. Advances the time by the specified number of weeks, setting the time to Sunday 
  96. 23:59:59.  The default is one.
  97. .TP
  98. \f3void end_year (int \f2n = \f11\f3);\f1
  99. Advances the time by the specified number of months, setting the time to 
  100. 31/12/yyyy 23:59:59.  The default is one.
  101. .TP
  102.  inline const char* get_country () const;
  103. Returns the country in ASCII format.
  104. .TP
  105.  inline int get_hour () const;
  106. Returns the value of the hour data member in the object (0-23).
  107. .TP
  108.  inline int get_mday () const;
  109. Returns the value of the day of the month data member in the object (1-31).
  110. .TP
  111.  inline int get_min () const;
  112. Returns the value of the minutes data member in the object (0-59). 
  113. .TP
  114.  inline int get_mon () const;
  115. Returns the value of the months data member in the object (0-11).
  116. .TP
  117.  inline int get_sec () const;
  118. Returns the value of the seconds data member in the object (0-59).
  119. .TP
  120.  inline const char* get_time_zone () const;
  121. Returns the time zone in ASCII format.
  122. .TP
  123.  inline int get_wday () const;
  124. Returns the value of the day of the week data member in the object (Sunday=0).
  125. .TP
  126.  inline int get_yday () const;
  127. Returns the value of the day of the year data member in the object (0-365)
  128. .TP
  129.  inline int get_year () const;
  130. Returns the value of the year data member in the object.
  131. .TP
  132. \f3void incr_day (int \f2n = \f11\f3);\f1
  133. Increments the time by the specified number of days. The default is one.
  134. .TP
  135. \f3void incr_hour (int \f2n = \f11\f3);\f1
  136. Increments the time by the specified number of hours. The default is one.
  137. .TP
  138. \f3void incr_min (int \f2n = \f11\f3);\f1
  139. Increments the time by the specified number of minutes. The default is one.
  140. .TP
  141. \f3void incr_month (int \f2n = \f11\f3);\f1
  142. Increments the time by the specified number of months. The default is one.
  143. .TP
  144. \f3void incr_sec (int \f2n = \f11\f3);\f1
  145. Increments the time by the specified number of seconds. The default is one.
  146. .TP
  147. \f3void incr_week (int \f2n = \f11\f3);\f1
  148. Increments the time by the specified number of weeks. The default is one.
  149. .TP
  150. \f3void incr_year (int \f2n = \f11\f3);\f1
  151. Increments the time by the specified number of years. The default is one.
  152. .TP
  153.  inline Boolean is_day_light_savings () const;
  154. Returns 
  155.  
  156.  TRUE 
  157. if daylight saving time is in effect; otherwise, returns 
  158.  
  159.  FALSE .
  160. .TP
  161. \f3inline long operator\- (const Date_Time& \f2dt\f3);\f1
  162. Computes the interval of time between the date and time object and 
  163.  dt .
  164. .TP
  165. \f3Date_Time& operator= (const Date_Time& \f2dt\f3);\f1
  166. Overloads the assignment operator to replicate the value of one date and time 
  167. object to another.
  168. .TP
  169. \f3Date_Time& operator+= (long \f2seconds\f3);\f1
  170. Performs interval addition and assignment.
  171. .TP
  172. \f3Date_Time& operator\-= (long \f2seconds\f3);\f1
  173. Performs interval subtraction and assignment.
  174. .TP
  175. \f3inline Boolean operator=\|= (const Date_Time& \f2dt\f3) const;\f1
  176. Overloads the equality operator for the 
  177.  Date_Time 
  178. class. This function returns 
  179.  
  180.  TRUE 
  181. if two objects represent the same time; otherwise, this function returns 
  182.  
  183.  FALSE . 
  184. .TP
  185. \f3inline Boolean operator!= (const Date_Time& \f2dt)\f3 const\f1
  186. Overloads the inequality operator for the 
  187.  Date_Time 
  188. class. This function returns 
  189.  
  190.  FALSE 
  191. if two objects represent the same time; otherwise, this function returns 
  192.  
  193.  TRUE .
  194. .TP
  195. \f3inline Boolean operator< (const Date_Time& \f2dt\f3) const;\f1
  196. Overloads the less-than operator for the 
  197.  Date_Time 
  198. class. This function returns 
  199.  
  200.  TRUE 
  201. if the date and time object represents a date and time before 
  202.  dt ; 
  203. otherwise, this function returns 
  204.  
  205.  FALSE .
  206. .TP
  207. \f3inline Boolean operator<= (const Date_Time& \f2dt\f3) const;\f1
  208. Overloads the less-than-or-equal operator for the 
  209.  Date_Time 
  210. class. This function returns 
  211.  
  212.  TRUE 
  213. if the date and time object represents a date and time 
  214. before or equal to 
  215.  dt ; 
  216. otherwise, this function returns 
  217.  
  218.  FALSE .
  219. .TP
  220. \f3inline Boolean operator> (const Date_Time& \f2dt\f3) const;\f1
  221. Overloads the greater-than operator for the 
  222.  Date_Time 
  223. class. This function 
  224. returns 
  225.  
  226.  TRUE 
  227. if the date and time object represents a date and time after 
  228.  dt ; 
  229. otherwise, this function returns 
  230.  
  231.  FALSE .
  232. .TP
  233. \f3inline Boolean operator>= (const Date_Time& \f2dt\f3) const;\f1
  234. Overloads the greater-than-or-equal operator for the 
  235.  Date_Time 
  236. class. This function returns 
  237.  
  238.  TRUE 
  239. if the date and time object represents a date and time 
  240. equal to or after 
  241.  dt ; 
  242. otherwise, this function returns 
  243.  
  244.  FALSE .
  245. .TP
  246. \f3void parse (char* \f2str\f3, int \f2settz = 0\f3);\f1
  247. Parses the character string 
  248.  str 
  249. input and fills all appropriate data members of 
  250. the date and time object. If no value is provided for 
  251.  settz , 
  252. the parsing 
  253. algorithm does not search for a time zone. The parser recognizes most  valid 
  254. input and always parses relative to the time zone. Fields not specified are 
  255. defaulted where appropriate. Illegal input results in an 
  256.  \f3\f3Error\f1\f1 
  257. exception being raised. 
  258. .TP
  259. \f3inline void set_country (country \f2c\f3);\f1
  260. Sets the country to the value 
  261.  c .
  262. .TP
  263.  void set_gm_time ();
  264. Sets the date and time to Greenwich mean time.
  265. .TP
  266.  void set_local_time ();
  267. Sets the date and time to local time as determined by the time zone and country 
  268. code values.
  269. .TP
  270. \f3inline void set_time_zone (time_zone \f2tz\f3);\f1
  271. Sets the time zone to the value 
  272.  tz .
  273. .TP
  274. \f3void start_day (int \f2n = \f11\f3);\f1
  275. Advances the time the specified number of days, setting the time to 00:00:00.  
  276. The default is one.
  277. .TP
  278. \f3void start_hour (int \f2n = \f11\f3);\f1
  279. Advances the time by the specified number of hours, setting the time to 
  280. hh:00:00.  The default is one.
  281. .TP
  282. \f3void start_min (int \f2n = \f11\f3);\f1
  283. Advances the time by the specified number of minutes, setting the time to 
  284. hh:mm:00.  The default is one.
  285. .TP
  286. \f3void start_month (int \f2n = \f11\f3);\f1
  287. Advances the time by the specified number of months, setting the time to 
  288. 01/mm/yyyy 00:00:00.  The default is one.
  289. .TP
  290. \f3void start_week (int \f2n = \f11\f3);\f1
  291. Advances the time by the specified number of weeks, setting the time to Monday 
  292. 00:00:00.  The default is one.
  293. .TP
  294. \f3void start_year (int \f2n = \f11\f3);\f1
  295. Advances the time by the specified number of years, setting the time to 
  296. 01/01/yyyy 00:00:00.  The default is one.
  297. .SH Friend Functions
  298. .TP
  299. \f3friend istream operator>> (istream& \f2is\f3, Date_Time& \f2dt\f3);\f1
  300. Overloads the input operator to read the input stream 
  301.  is , 
  302. and parses the 
  303. character string containing the date and time information. The result is 
  304. returned in the date and time object 
  305.  dt .
  306. .TP
  307. \f3friend ostream operator<< (ostream& \f2os\f3, const Date_Time* \f2dt\f3);\f1
  308. Overloads the output operator for a pointer to a date-and-time object.  The 
  309. object writes the output stream 
  310.  os 
  311. with a character string representing the 
  312. date and time object 
  313.  dt 
  314. formatted for the appropriate country.
  315. .TP
  316. \f3friend ostream operator<< (ostream& \f2os\f3, const Date_Time& \f2dt\f3);\f1
  317. Overloads the output operator for a reference to a date-and-time object. The 
  318. object writes the output stream 
  319.  os 
  320. with a character string representing the 
  321. date and time object 
  322.  dt 
  323. formatted for the appropriate country. 
  324. .TP
  325. \f3inline friend void set_default_country (country \f2c);\f1
  326. Sets the default country for the class to the value 
  327.  c . 
  328. .TP
  329. \f3inline friend void set_default_time_zone (time_zone \f2tz\f3);\f1
  330. Sets the default time zone for the class to the value 
  331.  tz .
  332. .SH COPYRIGHT
  333.  
  334. Copyright (C) 1991 Texas Instruments Incorporated.
  335.  
  336. Permission is granted to any individual or institution to use, copy, modify,
  337. and distribute this software, provided that this complete copyright and
  338. permission notice is maintained, intact, in all copies and supporting
  339. documentation.
  340.  
  341. Texas Instruments Incorporated provides this software "as is" without
  342. express or implied warranty.
  343.  
  344.